home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / tools / amiga / 3d_tools / irit40s.lha / Irit / geom_lib / geomat3d.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-30  |  2.4 KB  |  57 lines

  1. /******************************************************************************
  2. * GeoMat3d.h - Trans. Matrices , Vector computation, and Comp.geom.          *
  3. *******************************************************************************
  4. * Written by Gershon Elber, March 1990.                          *
  5. ******************************************************************************/
  6.  
  7. #ifndef    GEOMAT_3D_H
  8. #define GEOMAT_3D_H
  9.  
  10. #include "iritprsr.h"
  11.  
  12. /* Used by the Ray & Polygon intersection (Jordan theorem): */
  13. #define BELOW_RAY    1
  14. #define ON_RAY        2
  15. #define ABOVE_RAY    3
  16.  
  17. /* And prototypes of the functions: */
  18.  
  19. void GMVecCopy(VectorType Vdst, VectorType Vsrc);
  20. void GMVecNormalize(VectorType V);
  21. RealType GMVecLength(VectorType V);
  22. void GMVecCrossProd(VectorType Vres, VectorType V1, VectorType V2);
  23. RealType GMVecDotProd(VectorType V1, VectorType V2);
  24.  
  25. IPObjectStruct *GMGenMatObjectRotX(RealType *Degree);
  26. IPObjectStruct *GMGenMatObjectRotY(RealType *Degree);
  27. IPObjectStruct *GMGenMatObjectRotZ(RealType *Degree);
  28. IPObjectStruct *GMGenMatObjectTrans(VectorType Vec);
  29. IPObjectStruct *GMGenMatObjectScale(VectorType Vec);
  30. IPObjectStruct *GMGenMatObjectGeneric(IPObjectStruct *LstObjList);
  31. IPObjectStruct *GMTransformObject(IPObjectStruct *PObj, MatrixType Mat);
  32. IPObjectStruct *GMTransformObjectList(IPObjectStruct *PObj, MatrixType Mat);
  33.  
  34. /* And the computational geometry routines: */
  35. RealType CGDistPointPoint(PointType P1, PointType P2);
  36. int CGPlaneFrom3Points(PlaneType Plane, PointType Pt1, PointType Pt2,
  37.                             PointType Pt3);
  38. void CGPointFromPointLine(PointType Point, PointType Pl, PointType Vl,
  39.                         PointType ClosestPoint);
  40. RealType CGDistPointLine(PointType Point, PointType Pl, PointType Vl);
  41. RealType CGDistPointPlane(PointType Point, RealType Plane[4]);
  42. int CGPointFromLinePlane(PointType Pl, PointType Vl, RealType Plane[4],
  43.                     PointType InterPoint, RealType *t);
  44. int CGPointFromLinePlane01(PointType Pl, PointType Vl, RealType Plane[4],
  45.                     PointType InterPoint, RealType *t);
  46. int CG2PointsFromLineLine(PointType Pl1, PointType Vl1,
  47.               PointType Pl2, PointType Vl2,
  48.               PointType Pt1, RealType *t1,
  49.               PointType Pt2, RealType *t2);
  50. RealType CGDistLineLine(PointType Pl1, PointType Vl1,
  51.             PointType Pl2, PointType Vl2);
  52.  
  53. int CGPolygonRayInter(IPPolygonStruct *Pl, PointType PtRay, int RayAxes);
  54. int CGPolygonRayInter3D(IPPolygonStruct *Pl, PointType PtRay, int RayAxes);
  55.  
  56. #endif    /* GEOMAT_3D_H */
  57.